<?php echo $header; ?>
<div class="container">
	<div class="pagination_container clearfix">
		<h1 class="h1_search">
			Results for phone number <span><strong><?php echo  $_GET['num'] ?> </strong>
			</span>
		</h1>
		<div>
			<?php if(!isset($this->request->get['num'])){?>
			<p>
				Please insert a <strong>Phone number</strong>
			</p>
			<?php }?>
		</div>
	</div>
	<?php echo $content_top;?>
	<div class="pagination_container clearfix">
		<?php echo $pagination; ?>
	</div>
	<ul class="media-list">
		<?php foreach( $comments as $c): ?>
		<li class="media comment">
			<div class="media-body">
				<div class="comment_content">

					<div class="row">
						<div class="col-md-10">
							<h4 class="media-heading">
								<?php echo $c['header']?>
							</h4>

							<p class="comment_text">
								<?php echo $c['comment'] ?>
							</p>
						</div>
						<div class="ratting col-md-2">
							<?php $num = (int)$c['phone_comment_id']; ?>
							<a class="up_rate"
								href="javascript:submitRate('<?php echo $num ?>',1);"><i
								class="fa fa-thumbs-up fa-2x"></i> </a> <a class="down_rate"
								href="javascript:submitRate('<?php echo $num ?>',0);"><i
								class="fa fa-thumbs-down fa-2x"></i> </a>
						</div>
					</div>

				</div>
				<div class="comment_footer">
					<span><?php echo $c['footer']?> </span>
				</div>
			</div>
		</li>
		<?php endforeach; ?>
	</ul>
	<div class="pagination_container clearfix">
		<div>
			<?php echo $pagination; ?>
		</div>
	</div>
	<?php echo $content_bottom;?>
	<div class="denuncia_form">
		<form role="form" class="clearfix" method="post"
			action="index.php?route=phone/number/process"
			onsubmit="return controlaEnvio();">
			<div class="texto-web">
				<h3>
					<?php echo $text_report_number;?>
				</h3>
			</div>
			<fieldset class="report-number">
				<div class="form-group">
					<label for="numero"><?php echo $text_phone_number;?> <!--i class="fa fa-asterisk"></i-->
					</label> <input type="text" name="number" class="form-control"
						id="numero" value="<?php echo  $_GET['num'] ?>" disabled> <input
						type="hidden" name="number_id"
						value="<?php echo $phone['phone_id'] ?>">
				</div>
				<div class="form-group">
					<label for="comentario"><strong><?php echo $text_comment;?> </strong>
						<!--i class="fa fa-asterisk"></i--> </label>
					<textarea id="comentario" name="comment" class="form-control"
						rows="5" placeholder="<?php echo $text_note_comment;?>"><?php echo $comment; ?></textarea>
				</div>
				<div class="form-group">
					<div class="captcha"
						style="margin: 0px; margin-bottom: 10px; height: 115px">
						<img style="margin-bottom: 10px" id="captcha"
							src="<?php echo $captcha_link;?>" alt="" /> <input type="text"
							id="captcha_input" name="captcha"
							class="captcha_code bold center" placeholder="Captcha"
							maxlength="6" value="<?php echo $captcha; ?>" />
						<?php if ($error_captcha) { ?>
						<span class="error" style="color: red;"><?php echo $error_captcha; ?>
						</span>
						<?php } ?>
					</div>
				</div>
			</fieldset>
			<fieldset class="right collapse1">
				<div class="form-group">
					<label for="dueno"><?php echo $text_who_was_it;?> </label> <input
						type="text" id="owner" name="owner" class="form-control"
						value="<?php echo $owner; ?>" maxlength="45"
						placeholder="<?php echo $text_note_who_was_it;?>">
				</div>
				<div class="form-group">
					<label for="user"><?php echo $text_you_name;?> </label> <input
						type="text" id="user" name="user" class="form-control"
						value="<?php echo $user; ?>" maxlength="45"
						placeholder="<?php echo $text_note_you_name;?>">
				</div>
				<div class="form-group">
					<label for="tipo"><?php echo $text_call_type;?> </label><select
						id="call_type_id" name="call_type_id" class="form-control">
						<?php foreach($call_types as $calltype){ ?>
						<option value="<?php echo $calltype['call_type_id'];?>">
							<?php echo $calltype['name'];?>
						</option>
						<?php } ?>
					</select>
				</div>

			</fieldset>
			<fieldset class="captcha-button">
				<span class="nav-toggle"><a><i class="fa fa-minus-square"></i><span>&nbsp;Hide</span>
				</a> </span>
				<div class="form-group" id="numeric_captcha" style="display: none;">
					<label for="tipo">Please resolve this operation: 10+7</label> <input
						type="text" id="please_fill" name="required">
				</div>
				<button type="submit" class="btn btn-default">Send report</button>
			</fieldset>
		</form>
	</div>
	<div class="modal fade" id="errorModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">
						<i class="fa fa-times"></i>
					</button>
					<i class="fa fa-exclamation-triangle"></i>&nbsp;
					<h4 class="modal-title" id="myModalLabel"></h4>
				</div>
				<div class="modal-body" id="myModalMessage"></div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">
						<?php echo $button_close?>
					</button>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
        function submitRate(id, rate) {
            if (!(isNaN(id)) && !(isNaN(rate)) && (rate >= 0) && (rate <= 1)) {
                $('#rateNumRate').val(rate);
                $('#comment_id').val(id);
                $('#rateNum').submit();
            }
        }
	</script>
	<form action="index.php?route=phone/number/register" name="up"
		method="post" id="rateNum">
		<input type="hidden" name="rate" id="rateNumRate" value=""> <input
			type="hidden" name="comment_id" id="comment_id" value=""> <input
			type="hidden" name="total_rate" value="<?php echo $topRate ?>"> <input
			type="hidden" name="phone_id"
			value="<?php echo $phone['phone_id'] ?>">
	</form>
</div>
<?php echo $footer; ?>